package br.com.agiledev.webscrum.entity;

import static javax.persistence.CascadeType.REMOVE;
import static javax.persistence.FetchType.LAZY;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import static javax.persistence.CascadeType.PERSIST;
import static javax.persistence.CascadeType.REFRESH;
import static javax.persistence.CascadeType.MERGE;
import static javax.persistence.CascadeType.ALL;

/**
 * Entity implementation class for Entity: Team
 * 
 */
@Entity
@SequenceGenerator(name = "team", sequenceName = "se_team")
public class Team implements Serializable {

    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(generator = "team")
    private Long oid;
    
    @Column(length = 50, nullable = false, unique = true)
    private String nome;
    
    @Column(length = 255)
    private String Descricao;
    
    @OneToMany(fetch = LAZY, mappedBy = "team", cascade = { REMOVE, MERGE, PERSIST })
    List<ScrumRole> scrumRoles;
    
    public Team() {
	super();
    }

    public Long getOid() {
	return this.oid;
    }

    public void setOid(Long oid) {
	this.oid = oid;
    }

    public String getNome() {
	return this.nome;
    }

    public void setNome(String nome) {
	this.nome = nome;
    }

    public String getDescricao() {
	return this.Descricao;
    }

    public void setDescricao(String Descricao) {
	this.Descricao = Descricao;
    }

    public List<ScrumRole> getScrumRoles() {
        return scrumRoles;
    }

    public void setScrumRoles(List<ScrumRole> scrumRoles) {
        this.scrumRoles = scrumRoles;
    }

}
